package com.jybd.live.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.jybd.live.util.JsonDateSerializer;
import com.jybd.live.util.JsonTimestampToDateDeserializer;

import java.util.Date;

public class Record {
    private Integer id;

    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String domain;
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String app;
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String stream;
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String uri;

    private Double duration;

    @JsonDeserialize(using = JsonTimestampToDateDeserializer.class)
    @JsonSerialize(using = JsonDateSerializer.class)
    @JsonProperty("start_time")
    private Date startTime;

    @JsonDeserialize(using = JsonTimestampToDateDeserializer.class)
    @JsonSerialize(using = JsonDateSerializer.class)
    @JsonProperty("stop_time")
    private Date stopTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain == null ? null : domain.trim();
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app == null ? null : app.trim();
    }

    public String getStream() {
        return stream;
    }

    public void setStream(String stream) {
        this.stream = stream == null ? null : stream.trim();
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri == null ? null : uri.trim();
    }

    public Double getDuration() {
        return duration;
    }

    public void setDuration(Double duration) {
        this.duration = duration;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getStopTime() {
        return stopTime;
    }

    public void setStopTime(Date stopTime) {
        this.stopTime = stopTime;
    }
}